package com.hf.job

import com.hf.init.InitService
import com.hf.order.MailOrderService

class OrderJob {

	InitService initService
	MailOrderService mailOrderService

	static triggers = {
		// 9:20, default: Monday-Friday(cron: 2-6)
		cron name: 'orderJob', cronExpression: "0 20 9 ? * 1-7"
	}

	def execute() {
		log.info "job run!"

		initService.init()
		mailOrderService.sendMail()

		log.info "order email success"
	}
}
